home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / dev / gcc / ppc-mos-gcc.lha / ppc-morphos-gcc.readme < prev   
Text File  |  2002-06-19  |  6KB  |  195 lines

  1.  
  2.     Setting up a ppc-morphos cross compiler under AmigaOS
  3.     -----------------------------------------------------
  4.  
  5.  
  6. 1) If you don't have a GeekGadget environment:
  7.  
  8. Make a GeekGadget directory somewhere, and assign GG: to it.
  9.  
  10.    1> makedir some_volume:GeekGadgets
  11.    1> assign GG: some_volume:GeekGadgets
  12.  
  13. Make a GG:bin directory, and add it to your path, or add it to
  14. your c: assign.
  15.  
  16.    1> makedir GG:bin
  17.    1> path GG:bin add
  18.  
  19.  
  20. 2) Unarchive the ppc-morphos-binutils-2.9.1-bin.tgz and
  21.    ppc-morphos-gcc-2.95.3-bin.tgz in GG:
  22.  
  23.    1> cd GG:
  24.    1> tar xzf  some_dir/ppc-morphos-binutils-2.9.1-bin.tgz
  25.    1> tar xzf  some_dir/ppc-morphos-gcc-2.95.3-bin.tgz
  26.  
  27.  Warning 1:
  28.  ----------
  29. If you are unarchiving on a filesystem that doesn't support
  30. hard-links (e.g. SFS), you will have error messages and will
  31. need to make the links by hand (or replace them with copies).
  32. You need to have:
  33.   gg:ppc-morphos/bin/as     ->  gg:bin/ppc-morphos-as
  34.   gg:ppc-morphos/bin/ar     ->  gg:bin/ppc-morphos-ar
  35.   gg:ppc-morphos/bin/ld     ->  gg:bin/ppc-morphos-ld
  36.   gg:ppc-morphos/bin/nm     ->  gg:bin/ppc-morphos-nm
  37.   gg:ppc-morphos/bin/ranlib ->  gg:bin/ppc-morphos-ranlib
  38.   gg:ppc-morphos/bin/strip  ->  gg:bin/ppc-morphos-strip
  39.   gg:lib/gcc-lib/ppc-morphos/2.95.3/libstdc++.a
  40.              ->  gg:ppc-morphos/lib/libstdc++.a.2.10.0
  41.   gg:lib/gcc-lib/ppc-morphos/2.95.3/libb32/libstdc++.a
  42.              ->  gg:ppc-morphos/lib/libb32/libstdc++.a.2.10.0
  43. where "->" means "link to" or "copy of".
  44.  
  45.  Warning 2:
  46.  ----------
  47. If using soft links, you have to specify the full path of the
  48. destination, not just a relative one.
  49.  
  50.  Warning 3:
  51.  ----------
  52. If using soft links under SFS, you need at least SFS version 1.62.
  53.  
  54.  
  55. 3) Copy the contents of the emulinclude/includegcc directory
  56. to GG:ppc-morphos/sys-include
  57.  
  58.     1> copy somepath/emulinclude/includegcc GG:ppc-morphos/sys-include all
  59.  
  60.  
  61. 4) Copy the lib directory from the developer morphos archive to
  62. GG:ppc-morphos/lib and GG:ppc-morphos/lib/libnix
  63.  
  64.     1> copy somepath/lib/libamiga.a GG:ppc-morphos/lib
  65.     1> copy somepath/lib/libamigastubs.a GG:ppc-morphos/lib
  66.     1> copy somepath/lib/libsyscall.a GG:ppc-morphos/lib
  67.     1> copy somepath/lib/libstring.a GG:ppc-morphos/lib
  68.     1> copy somepath/lib/libstringio.a GG:ppc-morphos/lib
  69.  
  70.     1> copy somepath/lib/startup.o GG:ppc-morphos/lib/libnix
  71.     1> copy somepath/lib/__nocommandline.o GG:ppc-morphos/lib/libnix
  72.     1> copy somepath/lib/libc.a GG:ppc-morphos/lib/libnix
  73.  
  74.  
  75. 5) Get the ixemul-dev.tgz archive from the native MorphOS tools,
  76. and copy its include directory to GG:ppc-morphos/include and
  77. its lib directory to GG:ppc-morphos/lib.
  78.  
  79.     1> copy somepath/include GG:ppc-morphos/include all
  80.     1> copy somepath/lib GG:ppc-morphos/lib all
  81.  
  82.  
  83.  
  84.     Usage
  85.     -----
  86.  
  87. To compile 'hello.c' to 'hello' using ixemul:
  88.  
  89.    1> ppc-morphos-gcc -o hello hello.c
  90.  
  91. To compile 'hello.c' to 'hello' using libnix:
  92.  
  93.    1> ppc-morphos-gcc -noixemul -o hello hello.c
  94.  
  95. To strip debugging informations and symbols from an executable file:
  96.  
  97.    1> ppc-morphos-strip hello
  98.  
  99. To compile and link separately:
  100.  
  101.    1> ppc-morphos-gcc -c hello1.c
  102.    1> ppc-morphos-gcc -c hello2.c
  103.    1> ppc-morphos-gcc -o hello hello1.o hello2.o
  104.  
  105. (the last step can be replaced by a direct call to ppc-morphos-ld,
  106. but unlike with ppc-amigaos-ld, do *not* use the -r option with it,
  107. unless you really want pre-linkage.)
  108.  
  109.  
  110. * Some useful options:
  111.  
  112.    -O, -O2, -O3 to optimize (-O3 make files bigger, be careful)
  113.  
  114.    -mcpu=604e, -mcpu=603e to optimize for a cpu. Files optimized
  115. for one processor still work on others.
  116.  
  117.    -mmultiple allows using ppc's 'lmw' and 'stmw' instructions,
  118. which make the executable smaller.
  119.  
  120.    -mbaserel32 to use r13-relative data addressing (ixemul only)
  121.  
  122.    -mresident32 to build 'pure' executables (ixemul only).
  123.  
  124.    -mstackcheck to add stack checking (ixemul only).
  125.  
  126.    -mstackextend to add automatic stack extension (ixemul only).
  127.  
  128.    -v to view the exact commands executed by gcc, and its include
  129. search path. Useful to find out installation problems.
  130.  
  131.  
  132. * Predefined symbols:
  133.  
  134. __PPC__, __powerpc__, __MORPHOS__
  135.  
  136. __603e__ if compiled with -mcpu=603e
  137. __604e__ if compiled with -mcpu=604e
  138.  
  139. __amigaos__, amigaos, amiga, AMIGA, MCH_AMIGA for compatibility
  140.  
  141.  
  142. * Some remarks:
  143.  
  144. 1) This compiler uses the natural ppc alignment, i.e. in
  145.    struct S
  146.    {
  147.      short a;
  148.      long b;
  149.    };
  150.  
  151. the offset of 'b' is 4, and not 2 as with 68k compilers. You can
  152. force the alignment to be 2 by defining S as follow:
  153.  
  154.   struct S
  155.   {
  156.     short a;
  157.     long b __attribute__((aligned(2)));
  158.   } __attribute__((packed));
  159.  
  160. or even better by:
  161.  
  162.   #pragma pack(2)
  163.    struct S
  164.    {
  165.      short a;
  166.      long b;
  167.    };
  168.   #pragma pack()
  169.  
  170. Usually you shouldn't care about that, except in interfaces with
  171. external libraries, or for binary compatibility if you read/write
  172. such structures from/to files.
  173.  
  174. Attn: floats and doubles must _never_ have an alignment lower than 4.
  175.  
  176. 2) -mstrict-align should not be used anymore.
  177.  
  178. 3) The diff file on which this release was build can be found at:
  179.    http://www.morphos.de/meanmachine/files/gcc-2.95.3.diffs.bz2
  180.  
  181. 4) This version is a slightly modified version from the last
  182.    version released on the morphos.de homepage.
  183.    This compiler supports now __stackext and also the newly
  184.    introduced __attribute__((varargs68k)) statements.
  185.    So it is fully compatible with the "release/cisc" version of the
  186.    cross-compiler environment also avaible to MOS directly.
  187.  
  188.    See http://zapek.meanmachine.ch/morphos/morphos.html for examples
  189.    on how to port your AmigaOS applications.
  190.  
  191. Have phun
  192. and keep up the good work
  193.  
  194. Jens Langner <Jens.Langner@htw-dresden.de>
  195. June 2002